#!/bin/bash
export HOMEDIR=$(dirname $(dirname $(readlink -f "${BASH_SOURCE[0]}")))
source $HOMEDIR/scripts/init-env.sh

$OSEXEC gs_guc set -N all -I all -h "host all all 0.0.0.0/0 sha256"
$OSEXEC gs_guc set -N all -I all -c "password_policy = 0"
$OSEXEC gs_guc set -N all -I all -c "view_independent = on"
$OSEXEC gs_guc set -N all -I all -c "enable_usrpwd_case_insensitive = on"
$OSEXEC gs_guc set -N all -I all -c "max_connections = 1000"
$OSEXEC gs_guc set -N all -I all -c "max_concurrent_autonomous_transactions = 500"
$OSEXEC gs_guc set -N all -I all -c "enable_sqlcode_int = on"
$OSEXEC gs_guc set -N all -I all -c "plsql_global_cache_clean_timeinterval = 10000"
$OSEXEC gs_guc set -N all -I all -c "plsql_global_cache_max_memory = 20GB"
$OSEXEC gs_guc set -N all -I all -c "enable_cache_function_result = on"
$OSEXEC gs_guc set -N all -I all -c "function_result_cache_max_mem = 256MB"
$OSEXEC gs_guc set -N all -I all -c "enable_plsql_compiledepend = on" 
$OSEXEC gs_guc set -N all -I all -c "enable_global_sequence_cache = on" 
$OSEXEC gs_guc set -N all -I all -c "enable_pbe_optimization = off"
$OSEXEC gs_guc set -N all -I all -c "autovacuum_naptime = 10min"

echo "export PGCOMMENT=oracle" >> /home/$ptk_global_user/.ptk_mogdb_env
echo "export PGENABLESQLPLUS=true" >> /home/$ptk_global_user/.ptk_mogdb_env

#ptk cluster restart -n $ptk_global_cluster_name restart
source $HOMEDIR/scripts/set-track-level.sh